﻿@model MvcSEDOC.Models.grupo
@{
    ViewBag.Title = "Crear grupos de preguntas";
}

@section MenuSection
{
    @Html.Partial("_MenuAdminPartial")
}

@section SpecialJavascriptForView
{
    <script src="@Url.Content("~/Scripts/admin-CreateGroup.js")" type="text/javascript"></script>
}

<h2>Crear Grupo de Preguntas</h2>

@if (!string.IsNullOrEmpty(ViewBag.Message))
{
    <div class="accepted">@ViewBag.Message</div>
    <meta http-equiv="Refresh" content="1; url=@Url.Action("CreateGroup", "Admin")" />
}

@if (!string.IsNullOrEmpty(ViewBag.Error))
{
    <div class="errorEd">@ViewBag.Error</div>    
    
}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>


<form method="post" action="@Url.Action("CreateGroupo", "Admin")">
    <fieldset>
        <table>
            <tr>
                <td>
                    <div class="ui-widget">
	                    <label for="search_term">Tipo De Cuestionario: </label>
                    </div>
                 </td>
                 <td>
                     <div>
	                    @if (!string.IsNullOrEmpty(ViewBag.Message))
                        {
                            <input id="search_term" name='cuestionario' />
                        }
                        else if (!string.IsNullOrEmpty(ViewBag.Value1))
                        { 
                             <input id="search_term" name='cuestionario' value=@ViewBag.Value1 />                            
                        }
                     else
                     {
	                          <input id="search_term" name='cuestionario' />
                     }
                        <div class="editor-field">
                            @Html.HiddenFor(model => model.idcuestionario)
                            @Html.ValidationMessageFor(model => model.idcuestionario)
                        </div>
                     </div>
                </td>
                <td>                    
                    <a id="btnAddQuestionnaire" href="#" class="add">Agregar</a>
                </td>
            </tr>
            <tr>
                <td>
                  <div class="editor-label">
                        Nombre
                  </div> 
                </td>
                <td colspan="2">
                    <div class="editor-field">
                       @if (!string.IsNullOrEmpty(ViewBag.Message))
                       {
                            <input  name='nombre' id='search_term1' />   
                       }
                       else if (!string.IsNullOrEmpty(ViewBag.Value2))
                       { 
                           <input  name='nombre' id='search_term1' value=@ViewBag.Value2 />    
                          
                       }
                       else
                       { 
                            <input  name='nombre' id='search_term1' />   
                       }
                        
                        @if (!string.IsNullOrEmpty(ViewBag.Error2))
                        {
                        <span class="asterisco">*</span>         
                        } 
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="editor-label">
                    Porcentaje
                    </div>        
                </td>
                <td colspan="2">
                    <div class="editor-field">
                        @if (!string.IsNullOrEmpty(ViewBag.Message))
                        {
                           <input  name='porcentaje' id='search_term1' />
                        }
                        else if (!string.IsNullOrEmpty(ViewBag.Value3))
                        { 
                           <input  name='porcentaje' id='search_term1' value=@ViewBag.Value3 />                              
                        }
                        else
                        { 
                          <input  name='porcentaje' id='search_term1' />
                        }
                      
                        @if (!string.IsNullOrEmpty(ViewBag.Error3))
                        {
                        <span class="asterisco">*</span>         
                        }  
                    </div>
                </td>
            </tr>            
       </table>
       <p>
          <input type="submit" value="Crear"/>
       </p>
    </fieldset>
</form>


<div id="dialogCreateQuestionnaire" title="Crear Cuestionario">
 
        <fieldset>
            <table>
                <tr>
                    <td><div class="editor-label"><strong>Tipo Cuestionario:</strong></div></td>
                </tr>
                <tr>
                 <td>
                     <div class="editor-field">
                        <input type="text" id="tipoCuestionario" style="width:310px" /><br />
                        <span id="dialog_validation_msg"></span>
                     </div>   
                 </td>
               </tr>
            </table>  
        </fieldset>
</div>

<a class="miga" href="@Url.Action("Index", "Admin")"> Volver a Inicio </a>